<template>
  <div @click="change">{{ t('common.lang') }}</div>
  <!-- <el-button @click="change">
    {{ t('common.lang') }}
    {{ t('login.login') }}
    {{ t('common.test.name') }}
  </el-button>-->
</template>

<script lang="ts" setup>
import { commonStore } from '@/store'
import { useI18n } from 'vue-i18n'
const { t, locale } = useI18n()
const store = commonStore()
const change = () => {
  const currentLang = store.locale === 'zhCN' ? 'en' : 'zhCN'
  store.setLocale(currentLang)
  locale.value = currentLang
}
</script>

<style lang="scss" scoped>
div {
  width: 30px;
}
</style>
